package top.xcxdl.rural.config.consts;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Created by IntelliJ IDEA.
 * 微信信息绑定
 *
 * @Author : Ding
 * @create 2021/9/27 16:07
 */
@Component
@ConfigurationProperties(prefix = "wechat")
public class WxConst {

    @Value("${wechat.appId}")
    public void setAppId(String appId) {
        WxConst.APP_ID = appId;
    }

    @Value("${wechat.appSecret}")
    public void setAppSecret(String appSecret) {
        WxConst.APP_SECRET = appSecret;
    }

    @Value("${wechat.WxGetOpenIdUrl}")
    public void setWxGetOpenIdUrl(String wxGetOpenIdUrl) {
        WxConst.WX_GET_OPENID_URL = wxGetOpenIdUrl;
    }

    @Value("${wechat.WXMachId}")
    public void setWxMachId(String wxMachId) {
        WxConst.WX_MATCH_ID = wxMachId;
    }

    @Value("${wechat.WXPayApi}")
    public void setWxPayApi(String wxPayApi) {
        WxConst.WX_PAY_API = wxPayApi;
    }

    /**
     * 微信小程序appid
     */
    public static String APP_ID;
    /**
     * 微信小程序appSecret
     */
    public static String APP_SECRET;
    /**
     * 获取微信Openid的请求地址
     */
    public static String WX_GET_OPENID_URL;
    /**
     * WXMachId
     */
    public static String WX_MATCH_ID;
    /**
     * WXMachId微信appid+20211010+21:36:00
     */
    public static String WX_PAY_API;

}
